home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n22.arc / CDISK.PRG < prev    next >
Text File  |  1991-12-08  |  1KB  |  27 lines

  1. ***********************************************************************
  2. * CDISK.PRG                    Contains CURDISK() UDF for Clipper S87
  3. * Demonstrates use of CURDISK() Clipper UDF.
  4. ***********************************************************************
  5. ?
  6. ? "Current Disk Drive -> " + CURDISK()
  7. ?
  8. RETURN
  9.  
  10. ***********************************************************************
  11. * CURDISK() - Get current disk drive letter.     UDF for Clipper S87
  12. ***********************************************************************
  13. FUNCTION CURDISK
  14. PRIVATE xRetVal, xHandle1, xRow, xCol
  15.  
  16.    xRow = ROW()                               && save cursor position, row
  17.    xCol = COL()                               && and column
  18.    RUN CD > TMP.                              && run "CD" redirected to a file
  19.    xHandle1 = FOPEN("TMP.",0)                 && open file
  20.    xRetVal  = FREADSTR(xHandle1, 2)           && read first 2 chars
  21.    xRetVal  = IIF(":" $ xRetVal, xRetVal, "") && check for error
  22.    FCLOSE(xHandle1)                           && close file
  23.    ERASE TMP.                                 && erase file
  24.    @ xRow, xCol SAY ""                        && restore cursor position
  25.  
  26. RETURN xRetVal
  27.